package com.retailcloud.baseservice.controller;

import com.retailcloud.baseservice.service.TokenService;
import com.retailcloud.commonutils.utils.PageUtils;
import com.retailcloud.commonutils.utils.R;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author wudi
 * @date 2024/11/5
 * @comment
 */
@RestController
@RequestMapping("/token")
public class TokenController {

    @Resource
    TokenService tokenService;

    /**
     * 刷新token
     * @param params
     * @return
     */
    @RequestMapping("/refreshToken")
    //@RequiresPermissions(":users:list")
    public R refreshToken(@RequestParam Map<String, Object> params){
        String token = tokenService.refreshToken(params.get("token").toString());
        return R.ok().put("data", token);
    }




}
